package LL1checker;

import java.util.ArrayList;

public class Expression {
	private ArrayList<Term> terms;
	private NonTerminal nonTerm;
	private ArrayList<Term> starters;
	private ArrayList<Term> followers;
	private ArrayList<Term> alternatives;
	
	public Expression(){
		terms = new ArrayList<Term>();
		starters = new ArrayList<Term>();
		followers = new ArrayList<Term>();
		alternatives = new ArrayList<Term>();
	}
	
	public ArrayList<Term> getTerms(){
		return terms;
	}
	
	public void addTerm(Term newTerm){
		terms.add(newTerm);
	}
	
	public ArrayList<Term> getRestList(){
		
		//TODO:
		return followers;		
	}
	
	public ArrayList<Term> getStarters(){
		//TODO:
		return starters;
	}
	
	public void setStarters(){
		//TODO:
	}
	
	public ArrayList<Term> getFollowers(){
		return followers;
	}
	
	public void getAlternatives(){
		//TODO:
	}
	
	public void setNonTerminal(NonTerminal nTerm){
		nonTerm = nTerm;
	}
	
	public void setAlternatives(ArrayList<Term> newAlts){
		alternatives = newAlts;
	}
	
	public void addStarter(Term alternative){
		starters.add(alternative);
	}
	
	public void addListOfStarters(ArrayList<Term> multipleAlternatives){
		starters.addAll(multipleAlternatives);
	}
	

	public String toString(){
		String tmpStr = "";
		for (Term term : terms){
			tmpStr += term.getValue();
		}	
		return String.format("Expression: %s ", tmpStr);
	}
	
}
